package com.ddstation.onsitelaw.service;

import com.ddstation.onsitelaw.entity.AccountSaveEntity;
import com.ddstation.onsitelaw.entity.DtSupervisorEnforcementEntity;
import com.ddstation.onsitelaw.mapper.DtSupervisorEnforcementMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.inject.Inject;
import java.util.List;
import java.util.Map;

/**
 * @author 忆秋枫
 */
@Service
public class DtSupervisorEnforcementServiceImpl implements DtSupervisorEnforcementService {

    @Inject
    private DtSupervisorEnforcementMapper dtSupervisorEnforcementMapper;

    @Override
    @Transactional(readOnly = true)
    public List<DtSupervisorEnforcementEntity> selectListBySupervisorId(Integer supervisorId) {
        return dtSupervisorEnforcementMapper.selectListBySupervisorId(supervisorId);
    }

    @Override
    @Transactional(readOnly = true)
    public List<Map<String, Object>> selectMoreBySupervisorId(Integer supervisorId) {
        return dtSupervisorEnforcementMapper.selectMoreBySupervisorId(supervisorId);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void saveEnforcement(AccountSaveEntity saveEntity) {
        dtSupervisorEnforcementMapper.saveEnforcement(saveEntity);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void deleteEnforcement(Integer supervisorId) {
        dtSupervisorEnforcementMapper.deleteEnforcement(supervisorId);
    }
}